using System;

using Impact.Web.Foundation;
using Impact.Model.Objects;
using Impact.Infrastructure.Exceptions;

namespace Impact.Web.Controls
{
    public partial class DisplayImage : Impact.Web.Foundation.UserControlBase
    {
        /// <summary>
        /// loads the image that will be displayed
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (pageImage != null)
            {
                image.ImageUrl = pageImage.NextImage;
            }
            else
            {
                this.Visible = false;
            }

        }

        /// <summary>
        /// gets or sets the PageImage object to be displayed
        /// </summary>
        public PageImage PageImage
        {
            get { return pageImage; }
            set { pageImage = value; }
        }
        private PageImage pageImage;


    }
}